package net.peihuan.community.controller;

import net.peihuan.community.dao.UserMapper;
import net.peihuan.community.entity.User;
import net.peihuan.community.service.IUserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.RestController;

@RequestMapping("/user")
@RestController
public class UserController {

    @RequestMapping("/h")
    String x()
    {
        return "aaa";
    }

    @Autowired
    private IUserService userMapper;

    @RequestMapping("/show")
    @ResponseBody
    public User listAll() {
        return userMapper.show(1);
    }

}